package com.leyou.item.client;

import com.leyou.common.vo.PageResult;
import com.leyou.item.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("item-service")
public interface ItemClient {
    @GetMapping("/spu/page")
    PageResult<SpuDTO> findPage(
            @RequestParam(value = "page", defaultValue = "1") Integer page,
            @RequestParam(value = "rows", defaultValue = "5") Integer rows,
            @RequestParam(value = "saleable", required = false) Boolean saleable,
            @RequestParam(value = "key", required = false) String key);

    @GetMapping("sku/of/spu")
    List<SkuDTO> querySkuById(@RequestParam("id") Long id);

    @GetMapping("category/list")
    List<CategoryDTO> queryByIds(@RequestParam("ids") List<Long> idList);

    @GetMapping("brand/list")
    BrandDTO queryBrandById(@RequestParam("id") Long id);

    @GetMapping("spec/params")
    List<SpecParamDTO> querySpecParamByGid(@RequestParam(value = "gid", required = false) Long gid,
                                           @RequestParam(value = "cid", required = false) Long cid,
                                           @RequestParam(value = "searching", required = false) Boolean searching);
    @GetMapping("spu/detail")
   SpuDetailDTO queryGoodsById(@RequestParam("id") Long id);
    @GetMapping("brand/hello")
   List<BrandDTO> queryBrandByBrandIds(@RequestParam("ids") List<Long> ids);
}
